package com.controller;

import com.model.Food;
import com.service.FoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/elm/FoodController")
public class FoodController {
    @Autowired
    FoodService service;
    @PostMapping("/listFoodByBusinessId")
    public Object listFoodByBusinessId(int businessId)throws Exception{
        //调用service的方法
        List<Food> list = service.listFoodByBusinessId(businessId);
        return list;
    }
}
